# Contributor: Breno Leitao <breno.leitao@gmail.com>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=font-unifont
pkgver=15.1.04
pkgrel=0
pkgdesc="GNU Unifont glyphs"
url="https://unifoundry.com/unifont/index.html"
arch="all"
options="!check"  # No way to test fonts.
license="GFDL-1.3-or-later GPL-2.0-or-later WITH Font-exception-2.0"
subpackages="unifont-dev unifont-doc unifont-misc unifont-tools"
source="https://unifoundry.com/pub/unifont/unifont-$pkgver/unifont-$pkgver.tar.gz"
builddir="$srcdir/unifont-$pkgver"

prepare() {
	default_prepare
	# clean precompiled
	make clean
}

build() {
	make
}

package() {
	# renamed from unifont
	provides="unifont=$pkgver-r$pkgrel"
	replaces="unifont"

	make PREFIX="$pkgdir/usr" install

	cd "$pkgdir"/usr/share/unifont
	rm -r html ChangeLog* INSTALL* NEWS* README* ./*.pdf
}

tools() {
	depends="bdftopcf perl-gd"

	amove usr/bin
}

doc() {
	default_doc
	amove usr/share/unifont/*.info.*
}

misc() {
	pkgdesc="$pkgdesc (misc hex/bmp files)"

	amove usr/share/unifont
}

sha512sums="
0f3727708ecd75304b2e5d069c5c26e8673a624bf33c4d723e082faf3b2d3b33c73bb9b621ba8e90ddb8e1085dc1527e26a4754dd81f4e5445d53d4dacfef0e4  unifont-15.1.04.tar.gz
"
